package com.eatrip.bean;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;


@Entity
@Table(name = "commenti")
public class Commento implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 3059249865016005032L;
	
	@Id
	@Column(name = "id_commento")
	private int idCommento;
	
	@ManyToOne(cascade = CascadeType.REMOVE)
	@JoinColumn(name = "id_locale_fk")
	private DatiLocale datiLocale;
	
	@ManyToOne(cascade = CascadeType.REMOVE)
	@JoinColumn(name = "id_utente_fk")
	private User user;
	
	@Column(name = "commento")
	private String commento;

	public int getIdCommento() {
		return idCommento;
	}

	public void setIdCommento(int idCommento) {
		this.idCommento = idCommento;
	}

	
	public DatiLocale getDatiLocale() {
		return datiLocale;
	}

	public void setDatiLocale(DatiLocale datiLocale) {
		this.datiLocale = datiLocale;
	}

	
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public String getCommento() {
		return commento;
	}

	public void setCommento(String commento) {
		this.commento = commento;
	}

	@Override
	public String toString() {
		return "Commento [idCommento=" + idCommento + ", datiLocale="
				+ datiLocale + ", user=" + user + ", commento=" + commento
				+ "]";
	}

	

}
